package com.bruce.demo2.patterns.demo2.structural.demo12.flyweight.demo2;

/**
 * @PROJECT_NAME: design_patterns
 * @DESCRIPTION: T70坦克
 * @AUTHOR: CNBruceLee
 * @DATE: 2021/8/2 22:47
 */
public class Tank70 extends AbstractTank {
    private String option;

    @Override
    public String getOption() {
        return option;
    }

    public void setOption(String option) {
        this.option = option;
    }

    public Tank70() {
        super(FlyweightFactory.getInstance().getFlyweight("speed"),
                FlyweightFactory.getInstance().getFlyweight("shot"));
    }

    /**
     * 坦克速度外部状态获取方法
     *
     * @return
     */
    public int getSpeed() {
        return 80;
    }

    /**
     * 坦克射速外部状态获取方法，工内部调用
     *
     * @return
     */
    public int getShoot() {
        return 1200;
    }
}
